<%@ page language="java" pageEncoding="UTF-8" %>
<%@include file="/page/share/taglib.jsp" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath%>">

    <title>宿舍成员</title>
    <link type="text/css" href="css/base.css" rel="stylesheet"/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script type="text/javascript" src="<%=basePath%>/js/jquery.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>/js/verify.js"></script>
    <script type="text/javascript" src="../js/menu.js"></script>

    <script src='<%=basePath%>dwr/util.js' type="text/javascript"></script>
    <script src='<%=basePath%>dwr/engine.js' type="text/javascript"></script>
    <script src='<%=basePath%>dwr/interface/studentService.js' type="text/javascript"></script>
    <!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

    <script type="text/javascript">
        function change(stuId) {
            studentService.changeMonitor(stuId, fresh);
        }
        function fresh() {
            location.reload();
            alert('设置成功！');
            window.location.href = '/index.jsp';
        }

        $(document).ready(function () {
            studentService.isShowChangeMonitor("${person.powerGroup.powerGroup}", ${person.dormitory.id},isShow);
        });

        function isShow(show) {
            if (!show) {
//                document.forms['monitor'].hidden = true;
                $(".monitor").hide();
            }
        }
    </script>
</head>
<body>
<%@ include file="/page/share/menu.jsp" %>

<div id="content">
    <form method="post" action="#">
        <table>
            <tr>

                <td align="center">
                    学号
                </td>
                <td align="center">
                    姓名
                </td>
                <td align="center">
                    备注
                </td>
            </tr>
            <s:iterator value="students" var="student">
                <tr>
                    <td>
                        <c:if test="${student.monitor=='MONITOR'}">
                            <img src="/img/right.png" alt="" style="height: 30px;width: 30px;">
                        </c:if>
                        <c:if test="${student.monitor!='MONITOR'}">
                            <input type="radio" name="monitor" value="1" onchange="change(${student.studentId})"
                                   class="monitor"/>
                        </c:if>
                    </td>
                    <td align="center">
                            ${student.studentId}
                    </td>
                    <td align="center">
                            ${student.studentName}
                    </td>
                    <td align="center">
                            <%--<c:if test="${student.monitor=='MONITOR'}">--%>
                            <%--宿舍长--%>
                            <%--</c:if>--%>
                        <s:property value="#student.monitor"/>
                    </td>
                </tr>
            </s:iterator>
        </table>
    </form>
</div>

<div id="footer">
    <p style="text-align: center;color: #757575;padding: 20px 0px 0px 0px; font:12px;">Copyright © 2010-2013 蓝天白云团队
        版权所有</p>
</div>
</body>
</html>
